import PaginationDto from "apps/admin/src/dtos/pagination.dto";
import { ArrayMaxSize, ArrayMinSize, IsArray, IsBoolean, IsEmpty, IsNotEmpty, IsNumber, IsOptional, IsString, Max, MaxLength, Min } from "class-validator";

class CommonDto {
    @MaxLength(30)
    @IsNotEmpty()
    @IsString()
    name:string;

    @ArrayMaxSize(100)
    @IsArray()
    @IsOptional()
    menus:Array<number>;

    @MaxLength(100)
    @IsString()
    @IsOptional()
    remark:string;

    @IsBoolean({})
    @IsOptional()
    enable:boolean;

    @Min(0)
    @IsNumber({})
    @IsOptional()
    sort:number;
}

export class AddDto extends CommonDto {
    
}

export class EditDto extends CommonDto {
    
}

export class PageDto extends PaginationDto {}